package com.smartsofa.util;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.smartsofa.R;
public class ChangeInformation extends Activity {


	private Button bt_save;
	private EditText ed_changeinfo;
	private Button bt_changeinfo_back;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_changeinfo);
		
		bt_save = (Button) findViewById(R.id.bt_changesave);
		ed_changeinfo = (EditText) findViewById(R.id.ed_changeinfo);
		bt_save.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {				
				String edtdataString = ed_changeinfo.getText().toString().trim();
				if(!edtdataString.equals("")){
					Intent intent = getIntent();
					intent.putExtra("changeinfo", edtdataString);
					setResult(RESULT_OK,intent);
					finish();
				}
				else{
					Toast.makeText(ChangeInformation.this, "更改的信息不能为空！",Toast.LENGTH_SHORT).show();
				}
			}
		});
		bt_changeinfo_back=(Button) findViewById(R.id.bt_changeinfo_back);
		bt_changeinfo_back.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				ChangeInformation.this.finish();
			}
		});
		
	}


}
